package org.jeecg.modules.rooms.Enum;

import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.business.enums.CouponsEventEnum;

import java.util.ArrayList;
import java.util.List;

public enum RoomStatusEnum {

    EMPTY_CLEAR(1,"空净"),
    EMPTY_DIRTY(2,"空脏"),
    LIVE_CLEAR(3,"住净"),
    LIVE_DIRTY(4,"住脏"),
    IN_SERVICE(5,"维修"),
    ON_LOCK(6,"锁房"),
    RESERVE(7,"预定");

    Integer key;

    String title;

    RoomStatusEnum(Integer key, String title){
        this.key = key;
        this.title = title;
    }
    public Integer getKey() {
        return key;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 获取字典数据
     * @return
     */
    public static List<DictModel> getDictList(){
        List<DictModel> list = new ArrayList<>();
        DictModel dictModel = null;
        for(RoomStatusEnum e: RoomStatusEnum.values()){
            dictModel = new DictModel();
            dictModel.setValue(e.key.toString());
            dictModel.setText(e.title);
            list.add(dictModel);
        }
        return list;
    }

    public static RoomStatusEnum val(Integer key){
        for(RoomStatusEnum bld: values()){
            if(bld.key .equals(key)){
                return bld;
            }
        }
        return null;
    }
}
